package com.developmentReformProject.service.impl;

import com.developmentReformProject.dao.ThreeProjectDao;
import com.developmentReformProject.dto.ThreeQueryDto;
import com.developmentReformProject.dto.ThreeYearProjectDto;
import com.developmentReformProject.entity.Apply;
import com.developmentReformProject.entity.Enterprise;
import com.developmentReformProject.entity.FiveYearProject;
import com.developmentReformProject.entity.ThreeYearProject;
import com.developmentReformProject.service.ThreeYearProjectLibraryService;
import com.developmentReformProject.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ThreeYearProjectLibraryServiceImpl implements ThreeYearProjectLibraryService {
    @Autowired
    private ThreeProjectDao threeProjectDao;
    @Override
    public String addProject(ThreeYearProjectDto threeYearProjectDto) {
        return null;
    }

    @Override
    public String updateProject(ThreeYearProjectDto threeYearProjectDto) {
        return null;
    }

    @Override
    public String deleteProject(Integer projectNo) {
        return null;
    }

    @Override
    public String deleteProject(List[] projectNos) {
        return null;
    }

    @Override
    public ThreeYearProjectDto queryProjectById(Integer projectNo) {
        return null;
    }

    @Override
    public List<ThreeYearProjectDto> queryProjectList(List[] projectNo) {
        return null;
    }

    @Override
    public List<ThreeYearProjectDto> queryProjectByConstructionStatus(String constructionStatus) {
        return null;
    }

    @Override
    public List<ThreeYearProjectDto> queryProjectByentEnterpriseNumber(Enterprise enterprise) {
        return null;
    }

    @Override
    public List<ThreeYearProjectDto> queryProjectByRevenue(Double revenue) {
        return null;
    }

    @Override
    public List<ThreeYearProjectDto> queryProjectBySpecificType(String specificType) {
        return null;
    }

    @Override
    public String reportExport(Integer projectNo) {
        return null;
    }

    @Override
    public String overallAnalysisOfTheThreeYearProject(ThreeYearProjectDto threeYearProjectDto) {
        return null;
    }

    @Override
    public PageUtil<ThreeYearProject> pageList(ThreeQueryDto threeQueryDto) throws Exception {
        PageUtil<ThreeYearProject> pageUtil=null;
        //统计满足条件记录总数
        int total=threeProjectDao.countSelective(threeQueryDto);
        /*
         * 如果total>0,查询数据
         * 封装到pageUtil
         */
        if(total>0){
            List<ThreeYearProject> data=threeProjectDao.selectSelective(threeQueryDto);
            pageUtil=new PageUtil<>(total, data, threeQueryDto.getCurrentPage(), threeQueryDto.getPageSize());
        }
        return pageUtil;
    }

    @Override
    public PageUtil<ThreeYearProject> cleanThree(ThreeQueryDto threeQueryDto) throws Exception {
        PageUtil<ThreeYearProject> pageUtil=null;
        //统计满足条件记录总数
        int total=threeProjectDao.countClean(threeQueryDto);
        /*
         * 如果total>0,查询数据
         * 封装到pageUtil
         */
        if(total>0){
            List<ThreeYearProject> data=threeProjectDao.listDelete(threeQueryDto);
            pageUtil=new PageUtil<>(total, data, threeQueryDto.getCurrentPage(), threeQueryDto.getPageSize());
        }
        return pageUtil;
    }
}
